save multiple df to pkl

34

import os

out = 'mypath\\myfolder\\'

df_list = [df1, df2, df3, df4]
for i, df in enumerate(df_list, 1):
    df.to_pickle(os.path.join(out, f'\\df{i}.pkl')

Comments

Submit
0 Comments